<% if @media.upload_complete.nil? %>
  Upload Processing
  <% unless secondrun %>
    <%= periodically_call_remote(:url => { :action => 'imagestatus', :id => @media.id, :secondrun => true},  :condition => "movie_done == false", :frequency => '2', :update => 'imagediv') %>
  <% end %>
<% else %>
  <%= link_to_media_lightbox @media.mediable.public_filename(:large), @media.mediable.public_filename(:medium) %><br />
  <%= link_to 'View raw media ('+@media.mediable.width.to_s+'x'+@media.mediable.height.to_s+')', @media.mediable.public_filename %>
  <script type="text/javascript">
    //<![CDATA[
      movie_done = true;
    //]]>
  </script>
<% end %>

